#include <QMutex>
#include <QSize>
#include <QThread>
#include <QWaitCondition>
#include <QQueue>
#include <QSqlQuery>
#include <QVariant>
#include <QDateTime>

#include "Experiment.h"
#include "ExperimentResult.h"
#include "OcmfServerStatus.h"
#include "DbSqlStatements.h"

#ifndef DBCLIENT_H
#define DBCLIENT_H

class DbClient : public QThread
{
private:
    QSqlDatabase mySqlDatabase;

    void init();

public:

    //retreives all experiment files for a specified server instance
    QQueue<Experiment*> * GetScheduledExperiments(qlonglong serverId);

    //inserts the experiment into the database
    void AddExperimentResult(ExperimentResult experimentResult);

    //sets the status value of the server in the db which allows the client to be updated
    void SetServerStatus(qlonglong serverId, OcmfServerStatus ocmfServerStatus, Experiment * experiment);

    DbClient();
protected:
    void run();
};

#endif // DBCLIENT_H
